﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <string.h>
using namespace std;

struct ListNode {
    int val;
    ListNode* next;
    ListNode() : val(0), next(nullptr) {}
    ListNode(int x) : val(x), next(nullptr) {}
    ListNode(int x, ListNode* next) : val(x), next(next) {}
};

class Solution {
public:
    ListNode* deleteDuplicates(ListNode* head) {
        ListNode* phead = new ListNode();
        ListNode* cur = head;
        ListNode* pre = nullptr;
        ListNode* tmp = phead;
        while (cur)
        {
            pre = cur->next;
            int flag = 1;
            while (cur != nullptr && pre != nullptr && cur->val == pre->val)
            {
                if (flag)
                {
                    cur = pre->next;
                    flag = 0;
                }
                else
                {
                    cur = cur->next;
                    continue;
                }
            }
            if (flag == 0) continue;
            tmp->next = cur;
            if (cur) cur = cur->next;
            tmp = tmp->next;
            tmp->next = nullptr;
        }
        tmp = phead->next;
        delete phead;
        return tmp;
    }
};

int main()
{
    queue<int> qt;
    queue<int>& out = qt;
    cout << out.size();
    return 0;
}